#include "../comm.h"
class Solution {
public:
    vector<int> distributeCandies(int candies, int num_people) {
        vector<int> ans(num_people, 0);
        int now = 1, i = 0;
        while(candies)
        {
            int tt = min(now, candies);
            ans[i % num_people] += tt;
            candies -= tt;
            ++i;++now;
        }
        return ans;
    }
};